home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / misc / 39 / include / config.h next >
Encoding:
C/C++ Source or Header  |  1986-07-17  |  5.8 KB  |  176 lines

  1. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  2. /* config.h - version 1.0.3 */
  3.  
  4. #ifndef CONFIG    /* make sure the compiler doesnt see the typedefs twice */
  5.  
  6. #define    CONFIG
  7. #define    CHDIR        /* delete if no chdir() available */
  8.  
  9. /*
  10.  * Some include files are in a different place under SYSV
  11.  *     BSD           SYSV
  12.  * <strings.h>        <string.h>
  13.  * <sys/wait.h>        <wait.h>
  14.  * <sys/time.h>        <time.h>
  15.  * <sgtty.h>        <termio.h>
  16.  * Some routines are called differently
  17.  * index        strchr
  18.  * rindex        strrchr
  19.  * Also, the code for suspend and various ioctls is only given for BSD4.2
  20.  * (I do not have access to a SYSV system.)
  21.  */
  22. /* #define BSD        /* define for BSD */
  23. /* #define SYSV        /* define for System V */
  24. #define MSDOS     /* define for MS-DOS (actually defined by compiler) */
  25. /* #define TOS    /* define for Atari 520 or 1040 */
  26. /* #define UNIX        /* delete if no fork(), exec() available */
  27.  
  28. /* #define STUPID    /* avoid some complicated expressions if
  29.                your C compiler chokes on them */
  30. /* #define PYRAMID_BUG        /* avoid a bug on the Pyramid */
  31. /* #define NOWAITINCLUDE    /* neither <wait.h> nor <sys/wait.h> exists */
  32. #ifdef MSDOS
  33. #    define    NOWAITINCLUDE
  34. #endif MSDOS
  35.  
  36.  
  37. /*#define WIZARD  "kneller"    /* the person allowed to use the -D option */
  38. #define RECORD    "record"/* the file containing the list of topscorers */
  39. /* #define    NEWS    "news"    /* the file containing the latest hack news */
  40. #define    HELP    "help"    /* the file containing a description of the commands */
  41. #define    SHELP    "hh"    /* abbreviated form of the same */
  42. #ifdef TOS
  43. #define FMASK    0x8000
  44. #else TOS
  45. #define    FMASK    0660    /* file creation mask */
  46. #endif
  47.  
  48. #ifdef UNIX
  49. #define    HLOCK    "perm"    /* an empty file used for locking purposes */
  50. #define LLOCK    "safelock"    /* link to previous */
  51. /*
  52.  * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
  53.  * If defined, it can be overridden by the environment variable PAGER.
  54.  * Hack will use its internal pager if DEF_PAGER is not defined.
  55.  * (This might be preferable for security reasons.)
  56.  * #define DEF_PAGER    ".../mydir/mypager"
  57.  */
  58.  
  59. /*
  60.  * If you define MAIL, then the player will be notified of new mail
  61.  * when it arrives. If you also define DEF_MAILREADER then this will
  62.  * be the default mail reader, and can be overridden by the environment
  63.  * variable MAILREADER; otherwise an internal pager will be used.
  64.  * A stat system call is done on the mailbox every MAILCKFREQ moves.
  65.  */
  66. /* #define    MAIL */
  67. /* #define    DEF_MAILREADER    "/usr/ucb/mail"        /* or e.g. /bin/mail */
  68. /* #define    MAILCKFREQ    200 */
  69.  
  70.  
  71. /* #define SHELL        /* do not delete the '!' command */
  72.  
  73. #ifdef BSD
  74. #define    SUSPEND        /* let ^Z suspend the game */
  75. #endif BSD
  76. #endif UNIX
  77.  
  78. #ifdef CHDIR
  79. /*
  80.  * If you define HACKDIR, then this will be the default playground;
  81.  * otherwise it will be the current directory.
  82.  */
  83. #define HACKDIR    ""
  84.  
  85. /*
  86.  * Some system administrators are stupid enough to make Hack suid root
  87.  * or suid daemon, where daemon has other powers besides that of reading or
  88.  * writing Hack files. In such cases one should be careful with chdir's
  89.  * since the user might create files in a directory of his choice.
  90.  * Of course SECURE is meaningful only if HACKDIR is defined.
  91.  */
  92. /* #define SECURE        /* do setuid(getuid()) after chdir() */
  93.  
  94. /*
  95.  * If it is desirable to limit the number of people that can play Hack
  96.  * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
  97.  * #define MAX_NR_OF_PLAYERS    6
  98.  */
  99. #endif CHDIR
  100.  
  101. /* size of terminal screen is (at least) (ROWNO+2) by COLNO */
  102. #define    COLNO    80
  103. #define    ROWNO    22
  104.  
  105. /*
  106.  * small signed integers (8 bits suffice)
  107.  *    typedef    char    schar;
  108.  * will do when you have signed characters; otherwise use
  109.  *    typedef    short int schar;
  110.  */
  111. typedef    char    schar;
  112.  
  113. /*
  114.  * small unsigned integers (8 bits suffice - but 7 bits do not)
  115.  * - these are usually object types; be careful with inequalities! -
  116.  *    typedef    unsigned char    uchar;
  117.  * will be satisfactory if you have an "unsigned char" type; otherwise use
  118.  *    typedef unsigned short int uchar;
  119.  */
  120. typedef    unsigned char    uchar;
  121.  
  122. /*
  123.  * small integers in the range 0 - 127, usually coordinates
  124.  * although they are nonnegative they must not be declared unsigned
  125.  * since otherwise comparisons with signed quantities are done incorrectly
  126.  */
  127. typedef schar    xchar;
  128. typedef    xchar    boolean;        /* 0 or 1 */
  129. #define    TRUE    1
  130. #define    FALSE    0
  131.  
  132. /*
  133.  * Declaration of bitfields in various structs; if your C compiler
  134.  * doesnt handle bitfields well, e.g., if it is unable to initialize
  135.  * structs containing bitfields, then you might use
  136.  *    #define Bitfield(x,n)    uchar x
  137.  * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
  138.  */
  139. #define    Bitfield(x,n)    unsigned x:n
  140.  
  141. #define    SIZE(x)    (int)(sizeof(x) / sizeof(x[0]))
  142.  
  143. #ifdef MSDOS
  144. #define    exit    msexit        /* do chdir first */
  145. #ifdef getchar
  146. #    undef getchar
  147. #endif getchar
  148. #define getchar tgetch
  149. #define DGK            /* enhancements by dgk */
  150.  
  151. #ifdef DGK
  152. #ifdef TOS
  153. #    include "msdos.h"    /* contains necessary externs for tos.c */
  154. #else TOS
  155. #    include "msdos.h"    /* contains necessary externs for msdos.c */
  156. #    define SHELL        /* via exec of COMMAND.COM */
  157. #endif TOS
  158. #    define PATHLEN    64    /* maximum pathlength */
  159. #    define FILENAME 80    /* maximum filename length (conservative) */
  160. #    define FROMPERM    1    /* for ramdisk use */
  161. #    define TOPERM    2    /* for ramdisk use */
  162. #    define glo(x)    name_file(lock, x)    /* name_file used for bones */
  163. #    define creat(file, pmode)    check_then_creat(file, pmode)
  164.     /* screen symbols for using character graphics. */
  165.     struct symbols {
  166.         unsigned char vwall, hwall, tlcorn, trcorn, blcorn, brcorn;
  167.         unsigned char door, room, corr;
  168.     };
  169.     extern struct symbols symbol;
  170. #    define IS_CORNER(x)    ((x) == symbol.tlcorn || (x) == symbol.trcorn\
  171.                 || (x) == symbol.blcorn || (x)==symbol.brcorn)
  172. #endif DGK
  173. #endif MSDOS
  174.  
  175. #endif CONFIG
  176.